package model

import (
	"gorm.io/gorm"
	"zk3/petpal-service/config"
)

type PetPal struct {
	gorm.Model
	Image  string `gorm:"type:varchar(300);comment:头像"`
	Name   string `gorm:"type:varchar(30);comment:昵称"`
	Age    int    `gorm:"type:int(11);comment:年龄"`
	Sex    string `gorm:"type:varchar(30);comment:性别"`
	Status string `gorm:"type:varchar(30);comment:宠物类型"`
	Jy     string `gorm:"type:varchar(30);comment:绝育情况"`
	Ym     string `gorm:"type:varchar(30);comment:疫苗情况"`
	Qc     string `gorm:"type:varchar(30);comment:驱虫情况"`
}

func CreatePetPal(p *PetPal) error {

	return config.DB.Create(&p).Error
}
func FindPetPal(p *PetPal, PetPalID int) {

	config.DB.Where("ID=?", PetPalID).Find(&p)
}
